﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Hibiku.Twitter
{
    public class Location
    {
        public double Latitude
        {
            get;
            private set;
        }

        public double Longitude
        {
            get;
            private set;
        }

        public Place Place
        {
            get;
            private set;
        }

        public Location(double latitude, double longitude) : this(latitude, longitude, null)
        {
        }

        public Location(double latitude, double longitude, Place place)
        {
            Latitude = latitude;
            Longitude = longitude;
            Place = place;
        }

        public override string ToString()
        {
            return string.Format("{0},{1}", Latitude, Longitude);
        }

        public override bool Equals(object obj)
        {
            var other = obj as Location;

            return double.Equals(Latitude, other.Latitude) && double.Equals(Longitude, other.Longitude);
        }

        public override int GetHashCode()
        {
            return Latitude.GetHashCode() ^ Longitude.GetHashCode();
        }
    }
}
